import { request } from '@/axios/index.js'

// 获取用户列表
export const getUserList = (data) => {
  return request.get({
    url: '/user/list',
    params: data
  })
}

// 更新或保存用户
export const saveUser = (data) => {
  return request.post({
    url: '/user/save',
    data: data
  })
}

// 重置密码
export const resetPassword = (data) => {
  return request.post({
    url: '/user/reset-password',
    data: data
  })
}

// 删除用户
export const deleteUser = (id) => {
  return request.delete({
    url: '/user/delete/' + id
  })
}

// 登录
export const login = (data) => {
  return request.post({
    url: '/user/login',
    data: data
  })
}

// 退出登录
export const logout = (token) => {
  return request.get({
    url: '/user/logout/' + token
  })
}
